package com.example.ucf.graphics;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;


public class UCF_SurfaceView extends GLSurfaceView {
	UCF_Renderer renderer;
	
	public UCF_SurfaceView(Context context) {
		super(context);
		
		this.renderer = new UCF_Renderer(context, this.getDrawingCache());
		this.setRenderer(renderer);
		
		this.setOnTouchListener(onTouch);
	}
	
	private OnTouchListener onTouch = new OnTouchListener() {
		
		public boolean onTouch(View v, MotionEvent event) {
			renderer.setBackgroundColor(event.getX()/getWidth(), event.getY()/getHeight(), 1f);
			return false;
		}
	};
}
